let path = require("path")

console.log(path.basename("https://x.dscmall.cn/category-860.html?username=admin#777"));
//可以获取文件名
console.log(path.basename("https://x.dscmall.cn/category-860.html", ".html"));

//最后一个/之前的所有内容
console.log(path.dirname("https://x.dscmall.cn:8080/api/category/category-860.html?username=admin#777"));


//获取文件全名(文件名和后缀)
console.log(path.extname("https://x.dscmall.cn/category-860.html"));
console.log(path.basename("https://www.baidu.com/img/PCfb_5bf082d29588c07f842ccde3f97243ea.png"));


// 解下为对象
console.log(path.parse("https://x.dscmall.cn:8080/api/category/category-860.html?username=admin#777"));


// 拼接 http:\fckjhn.cn\page\static\css
console.log(path.join('http://fckjhn.cn/', 'page', 'static', 'css'));